﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Data.Schema.ScriptDom;
using Microsoft.Data.Schema.ScriptDom.Sql;
using System.Diagnostics;

namespace TSQLPARSER
{

    [DebuggerDisplay("Table = {TableName},Alias={Alias},Target={TblType}")]
        public sealed class xTable
        {
        public string Alias { get; set; }
        public string TableName { get; set; }
        public string Database { get; set; }
        public string Server { get; set; }
        public string Tbltype { get; set; }

        public override string ToString()
        {
            return TableName;
        }

        }
    [DebuggerDisplay("Column = {Column},Alias={TableAlias},Table={Table}")]
        public sealed class xColumn
        {
            public string TableAlias{get;set;}
            public string Column { get; set; }
            public string Table { get; set; }
            public override string ToString()
            {
                return Column;
            }

        }
        public sealed class xStatement
        {
            public List<xTable> xTableList { get; set; }
            public List<xColumn> xColumnList { get; set; }
            public string Type { get; set; }
            public string SqlSnippet { get; set; }

            public bool IsPopulated
            {
                get
                {
                    if (xTableList.Count > 0) return true;
                    else if (xColumnList.Count > 0) return true;
                    else return false;
                }
            }
        }

}
